FWU: Pass client cookie to FWU_SMC_UPDATE_DONE
authorDan Handley <[email protected]>
Tue, 15 Dec 2015 14:28:24 +0000 (14:28 +0000)
committerDan Handley <[email protected]>
Tue, 15 Dec 2015 14:33:25 +0000 (14:33 +0000)
The current FWU_SMC_UPDATE_DONE implementation incorrectly passes
an unused framework cookie through to the 1st argument in the
platform function `bl1_plat_fwu_done`. The intent is to allow
the SMC caller to pass a cookie through to this function.

This patch fixes FWU_SMC_UPDATE_DONE to pass x1 from the caller
through to `bl1_plat_fwu_done`. The argument names are updated
for clarity.

Upstream platforms currently do not use this argument so no
impact is expected.

Change-Id: I107f4b51eb03e7394f66d9a534ffab1cbc09a9b2

bl1/bl1_fwu.c
include/plat/common/platform.h
plat/arm/board/juno/juno_bl1_setup.c
plat/common/plat_bl1_common.c

index 05759212d28be2c2f8967acb3257df4613f924bc..5e8ee8e3cd8881103c4e9a72ac0447e41202c8b6 100644 (file)
@@ -64,7 +64,7 @@ static register_t bl1_fwu_image_resume(unsigned int image_id,
                        unsigned int flags);
 static int bl1_fwu_sec_image_done(void **handle,
                        unsigned int flags);
-__dead2 static void bl1_fwu_done(void *cookie, void *reserved);
+__dead2 static void bl1_fwu_done(void *client_cookie, void *reserved);
 
 /*
  * This keeps track of last executed secure image id.
@@ -101,7 +101,7 @@ register_t bl1_fwu_smc_handler(unsigned int smc_fid,
                SMC_RET1(handle, bl1_fwu_sec_image_done(&handle, flags));
 
        case FWU_SMC_UPDATE_DONE:
-               bl1_fwu_done(cookie, NULL);
+               bl1_fwu_done((void *)x1, NULL);
                /* We should never return from bl1_fwu_done() */
 
        default:
@@ -492,13 +492,13 @@ static int bl1_fwu_sec_image_done(void **handle, unsigned int flags)
  * This function provides the opportunity for users to perform any
  * platform specific handling after the Firmware update is done.
  ******************************************************************************/
-__dead2 static void bl1_fwu_done(void *cookie, void *reserved)
+__dead2 static void bl1_fwu_done(void *client_cookie, void *reserved)
 {
        NOTICE("BL1-FWU: *******FWU Process Completed*******\n");
 
        /*
         * Call platform done function.
         */
-       bl1_plat_fwu_done(cookie, reserved);
+       bl1_plat_fwu_done(client_cookie, reserved);
        assert(0);
 }
index c21f9ee8380b20b2073395160e5edeb7d7fe7320..687c2212ad5aa57b3b986bb277c15b6bf7a6314d 100644 (file)
@@ -121,7 +121,7 @@ struct image_desc *bl1_plat_get_image_desc(unsigned int image_id);
  * The following functions are used by firmware update
  * feature and may optionally be overridden.
  */
-__dead2 void bl1_plat_fwu_done(void *cookie, void *reserved);
+__dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved);
 
 
 /*******************************************************************************
index 61a57381774f3c57dd214784158b5ce430ddadc0..e805c9a38594f41826feead5f62050ca92d581f4 100644 (file)
@@ -72,7 +72,7 @@ void bl1_plat_set_ep_info(unsigned int image_id,
 /*******************************************************************************
  * On Juno clear SYS_NVFLAGS and wait for watchdog reset.
  ******************************************************************************/
-__dead2 void bl1_plat_fwu_done(void *cookie, void *rsvd_ptr)
+__dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved)
 {
        unsigned int *nv_flags_clr = (unsigned int *)
                        (V2M_SYSREGS_BASE + V2M_SYS_NVFLAGSCLR);
index aee9440a34200ddb215f4ff71838f1ea7d6617ca..e637aaf0e1855d080803c29d1545940b96914ab7 100644 (file)
@@ -69,7 +69,7 @@ image_desc_t *bl1_plat_get_image_desc(unsigned int image_id)
        return &bl2_img_desc;
 }
 
-__dead2 void bl1_plat_fwu_done(void *cookie, void *rsvd_ptr)
+__dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved)
 {
        while (1)
                wfi();